
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>广州现代教务系统管理</title>
    <style>
        tr{
            height: 36px;
            text-align: center;
        }
        input{
            border: none;
            outline: none;
            width: 100%;
            height: 36px;
        }

        .out:hover{
            background-color: aqua;
        }
        a:link {color: blue; text-decoration:none;}
    </style>
</head>
<body>
<h1 style="text-align: center">广州现代教务系统管理</h1>
<div>
    <%@ include file="/common.jsp" %>
</div>
<div style="display: flex;justify-content: center">
    <div>
        <c:if test="${loginState == null}">
            <br>
            <br>
            <br>
            <div>
                <div style="width: 100%;display: flex;justify-content: center;flex-direction: row;align-items: center;">
                    <div style="display: flex;justify-content: center;width: 500px">

                        <table width="630px"  border="1" cellspacing="0" style="line-height: 36px">
                            <form action='/index/login.do' method='post'>
                                <tr>
                                    <td>手机号:</td> <td><input type='text' name='phone' placeholder="Phone Number"  maxlength="9" required="required" oninput="value=value.replace(/[^\d]/g,'')"></td>
                                </tr>
                                <tr>
                                    <td>密码:</td><td><input type='text' name='pwd' placeholder="Password" required="required" maxlength="15"></td>
                                </tr>
                                <tr>
                                    <td></td>
                                    <td><input type="submit" class="out" value="登录"></td>
                                </tr>
                            </form>
                        </table>

                    </div>
                </div>
            </div>
            <H2 style="text-align: center">${err}</H2>

        </c:if>
    </div>
    <div>
        <c:if test="${loginState != null}">
            <div>
                <div style=" width: 100%;text-align: center">
                    <c:if test="${loginState.role == 1}">
                        <h3>学生-成绩查询</h3>
                        <table width="630px"   cellspacing="0" style="line-height: 36px">
                            <tr></tr>
                            <tr><td><input type="button" class="out" onclick='window.open("/student/update.do")' value="修改密码"/></td></tr>
                            <tr><td>${update}</td></tr>
                            <tr><td><input type="button" class="out" onclick='window.open("/student/show.do")' value="我的课程查询-我所在班级的课程表-有点难"/></td></tr>
                            <tr></tr>
                            <tr><td><input type="button" class="out" onclick='window.open("/student/findScore.do")' value="我的成绩查询 - 有点难-没有做成绩录入的可以造数据"/></td></tr>
                        </table>

                    </c:if>
                    <c:if test="${loginState.role == 2}">
                        <h3>任课-教师登分</h3>
                        <table width="630px"   cellspacing="0" style="line-height: 36px">
                            <tr></tr>
                            <tr><td><input type="button" class="out" onclick='window.open("/teacher/update.do")' value="修改密码"/></td></tr>
                            <tr><td>${update}</td></tr>
                            <tr><td><input type="button" class="out" onclick='window.open("/teacher/findClass.do")' value="登分管理及课程查询-难-挑战题"/></td></tr>
                        </table>
                    </c:if>
                    <c:if test="${loginState.role == 0}">
                        <h3>管理员-班级课程学生</h3>
                        <table width="630px"   cellspacing="0" style="line-height: 36px">
                            <tr></tr>
                            <tr><td><input type="button" class="out" onclick='window.open("/Administrator/classManager.do")' value="班级管理"/></td></tr>
                            <tr></tr>
                            <tr><td><input type="button" class="out" onclick='window.open("/Administrator/courses.do")' value="课程管理"/></td></tr>
                            <tr></tr>
                            <tr><td><input type="button" class="out" onclick='window.open("/Administrator/personStu.do")' value="学生管理"/></td></tr>
                            <tr></tr>
                            <tr><td><input type="button" class="out" onclick='window.open("/Administrator/personTea.do")' value="教师管理"/></td></tr>
                            <tr></tr>
                            <tr><td><input type="button" class="out" onclick='window.open("/Administrator/task.do")' value="安排教师到班级去上课-有点难"/></td></tr>
                            <tr></tr>
                        </table>


                    </c:if>
                </div>

            </div>
        </c:if>
    </div>
</div>
</body>
</html>
